package com.cennavi.filter;

import org.drools.core.spi.Activation;

import org.kie.api.runtime.rule.AgendaFilter;
import org.kie.api.runtime.rule.Match;

import javax.servlet.annotation.WebFilter;

/**
 * Created by lixiaoshuang on 2018/10/14.
 */
@WebFilter
public class Myfilter implements AgendaFilter {

    private String ruleName;

    public Myfilter(String ruleName) {
        this.ruleName = ruleName;
    }

    @Override
    public boolean accept(Match match) {
        return match.getRule().getName().equals(ruleName) ? true : false;
    }
}
